package com.group.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.group.pojo.TbBasedata;
import com.group.service.BasedataService;

@Controller
@RequestMapping("/basedata")
public class BasedataController {

	@Autowired
	private BasedataService basedataService;
	
	@RequestMapping("/page.action")
	public String page() {
		return "admin/basedata";
	}
	
	@RequestMapping("/query.action")
	@ResponseBody
	public List<TbBasedata> query(TbBasedata basedata) {
		List<TbBasedata> list = basedataService.query(basedata);
		return list;
	}
	
	@RequestMapping("/save.action")
	@ResponseBody
	public Map<String, String> save(TbBasedata basedata) {
		Map<String, String> map = basedataService.save(basedata);
		return map;
	}
	
	@RequestMapping("/update.action")
	@ResponseBody
	public Map<String, String> update(TbBasedata basedata) {
		Map<String, String> map = basedataService.update(basedata);
		return map;
	}
	
	@RequestMapping("/batchDelete.action")
	@ResponseBody
	public Map<String, String> batchDelete(@RequestParam(value = "basedataIds[]")String[] basedataIds) {
		Map<String, String> map = basedataService.batchDelete(basedataIds);
		return map;
	}
}
